//
//  NYCourseHeaderSectionView.m
//  NiuWaJiaoYu
//
//  Created by MinLison on 2018/1/10.
//  Copyright © 2018年 niuwaketang. All rights reserved.
//

#import "NYCourseHeaderSectionView.h"

@interface NYCourseHeaderSectionView ()

@property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) UIView *markView;

@end

@implementation NYCourseHeaderSectionView

- (instancetype)initWithReuseIdentifier:(nullable NSString *)reuseIdentifier {
        self = [super initWithReuseIdentifier:reuseIdentifier];
        if (self) {
                
                [self initUI];
        }
        return self;
}
- (void)initUI {
        
        self.contentView.backgroundColor = UIColorMakeWithHex(@"#FFFFFF");
        [self.contentView addSubview:self.nameLabel];
        [self.contentView addSubview:self.markView];

        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                
                make.right.bottom.top.equalTo(self.contentView);
                make.left.mas_equalTo(27);
        }];
        [self.markView mas_makeConstraints:^(MASConstraintMaker *make) {
                
                make.top.equalTo(self.contentView).offset(15);
                make.bottom.equalTo(self.contentView.mas_bottom).offset(-15);
                make.left.mas_equalTo(15);
                make.height.mas_equalTo(15);
                make.width.mas_equalTo(3);
        }];

}

- (void)setTitle:(NSString *)title {
        _title  = title;
        self.nameLabel.text = title;
}

- (UILabel *)nameLabel {
        if (!_nameLabel) {
                _nameLabel = [[UILabel alloc] initWithFrame:CGRectZero];
                _nameLabel.textColor = UIColorMakeWithHex(@"#666666");
                _nameLabel.font = UIFontMake(15);
        }
        return _nameLabel;
}
- (UIView *)markView {
        if (!_markView) {
                _markView = [[UIView alloc] initWithFrame:CGRectZero];
                _markView.backgroundColor = UIColorMakeWithHex(@"#3696FF");
        }
        return _markView;
}

@end
